﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MagicBag.CRM.Model;

namespace MagicBag.CRM.IDAL
{
    /// <summary>
    /// 通用字典数据表访问接口
    /// </summary>
    public interface ICommonDictionary
    {
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="dic"></param>
        /// <returns></returns>
        int Insert(CommonDictionary dic);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        int Delete(int id);

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="dic"></param>
        /// <returns></returns>
        int Update(CommonDictionary dic);
      
        /// <summary>
        /// 根据ID获取字典数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        CommonDictionary GetCommonDictionary(int id);

        /// <summary>
        /// 根分类名称获取字典数据列表
        /// </summary>
        /// <param name="category"></param>
        /// <returns></returns>
        IList<CommonDictionary> GetCommonDictionary(string category);

        /// <summary>
        /// 获取所有字典数据列表
        /// </summary>
        /// <returns></returns>
        IList<CommonDictionary> GetCommonDictionaries();


        /// <summary>
        /// 分页获取通用字典表数据
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        IList<CommonDictionary> GetCommonDictionaries(int pageIndex, int pageSize,out int total);

        /// <summary>
        /// 获取所有分类
        /// </summary>
        /// <returns></returns>
        IList<CommonDictionary> GetCategories();

    }
}
